From: Jan Beulich Date: Mon, 2 Mar 2020 09:49:48 +0000 (+0100) Subject: IOMMU/x86: don't bypass softirq processing in arch_iommu_hwdom_init() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~596 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=9cedfab5e4b50bd1c6276413766350e2bff33b26;p=xen.git IOMMU/x86: don't bypass softirq processing in arch_iommu_hwdom_init() Even when a page doesn't need mapping, we should check whether softirq processing should be invoked. Otherwise with sufficiently much RAM chances of a to-be-mapped page actually occurring with the loop counter having the "right" value may become diminishingly small. Reported-by: Andrew Cooper Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné Tested-by: Andrew Cooper --- diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c index 2cf528e760..6b4360ba39 100644 --- a/xen/drivers/passthrough/x86/iommu.c +++ b/xen/drivers/passthrough/x86/iommu.c @@ -226,9 +226,8 @@ void __hwdom_init arch_iommu_hwdom_init(struct domain *d) int rc; if ( !hwdom_iommu_map(d, pfn, max_pfn) ) - continue; - - if ( paging_mode_translate(d) ) + rc = 0; + else if ( paging_mode_translate(d) ) rc = set_identity_p2m_entry(d, pfn, p2m_access_rw, 0); else rc = iommu_map(d, _dfn(pfn), _mfn(pfn), PAGE_ORDER_4K,